Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ped fightback chance and fix need to press F before pulling weapon #270

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

t0xicVybez
Copy link

Describe Pull request
Pull request fixes the requirement of Flexing F muscle then drawing weapon to start the carjacking proccess.
Now you just Aim a weapon at the Ped driver and it starts the carjacking proccess.
Adds the ability to have the peds defend themself through adjustable configuration options (PedDefenseChance, PedAccuracy)

Peds are given a Pistol by default but can be changed client side.

-- Setup combat attributes
GiveWeaponToPed(target, WEAPON_PISTOL, 255, false, true)
SetPedCombatAttributes(target, 46, true)
SetPedFleeAttributes(target, 0, false)
SetPedCombatRange(target, 2)
SetPedCombatMovement(target, 2)
SetPedAccuracy(target, Config.PedAccuracy)

If your PR is to fix an issue mention that issue here

Questions (please complete the following information):

  • Have you personally loaded this code into an updated qbcore project and checked all it's functionality? yes gave over 500 Test runs with multiple different players in different areas
  • Does your code fit the style guidelines? yes
  • Does your PR fit the contribution guidelines? belive so yes

Fixed so you no longer have to flex F first then draw your weapon to start the carjacking proccess. Also adding the ability to configure peds to fight back.

New behavior
Point gun at driver Script then does a Chance the ped will getout and pull a gun and start shooting, If ped does and dies Carjacking = failed. If ped doesnt exit with a weapon they exit then flee giving you keys.
Config.PedDefenseChance = 0.6 -- Probability (0-1) that a ped will defend themselves
Config.PedAccuracy = 50 -- How accurate the ped's shooting will be (1-100)

Config options added to support the new ped defense feature.
client/main.lua Outdated Show resolved Hide resolved
client/main.lua Outdated Show resolved Hide resolved
config.lua Show resolved Hide resolved
@t0xicVybez
Copy link
Author

@Qwerty1Verified fixed your requests i believe still is working functionally as is supposed to with the new changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants